home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Picker.p < prev    next >
Encoding:
Text File  |  1989-10-13  |  2.1 KB  |  88 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Thursday, August 18, 1988 at 11:51 AM
  3.     Picker.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.    1987-1988
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Picker;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingPicker}
  21. {$SETC UsingPicker := 1}
  22.  
  23. {$I+}
  24. {$SETC PickerIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := PickerIncludes}
  30.  
  31. CONST
  32. MaxSmallFract = $0000FFFF;        {Maximum small fract value, as long}
  33.  
  34.  
  35. TYPE
  36.  
  37. SmallFract = INTEGER;
  38.  
  39. HSVColor = RECORD
  40.     hue: SmallFract;            {Fraction of circle, red at 0}
  41.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  42.     value: SmallFract;            {0-1, 0 for black, 1 for max intensity}
  43.     END;
  44.  
  45. { For developmental simplicity in switching between the HLS and HSVmodels, HLS is
  46.  reordered into HSL.  Thus both models start with hue and saturation values;
  47.  value/lightness/brightness is last. }
  48.  
  49. HSLColor = RECORD
  50.     hue: SmallFract;            {Fraction of circle, red at 0}
  51.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  52.     lightness: SmallFract;        {0-1, 0 for black, 1 for white}
  53.     END;
  54.  
  55. CMYColor = RECORD
  56.     cyan: SmallFract;
  57.     magenta: SmallFract;
  58.     yellow: SmallFract;
  59.     END;
  60.  
  61.  
  62.  
  63. FUNCTION Fix2SmallFract(f: Fixed): SmallFract;
  64.     INLINE $3F3C,$0001,$A82E;
  65. FUNCTION SmallFract2Fix(s: SmallFract): Fixed;
  66.     INLINE $3F3C,$0002,$A82E;
  67. PROCEDURE CMY2RGB(cColor: CMYColor;VAR rColor: RGBColor);
  68.     INLINE $3F3C,$0003,$A82E;
  69. PROCEDURE RGB2CMY(rColor: RGBColor;VAR cColor: CMYColor);
  70.     INLINE $3F3C,$0004,$A82E;
  71. PROCEDURE HSL2RGB(hColor: HSLColor;VAR rColor: RGBColor);
  72.     INLINE $3F3C,$0005,$A82E;
  73. PROCEDURE RGB2HSL(rColor: RGBColor;VAR hColor: HSLColor);
  74.     INLINE $3F3C,$0006,$A82E;
  75. PROCEDURE HSV2RGB(hColor: HSVColor;VAR rColor: RGBColor);
  76.     INLINE $3F3C,$0007,$A82E;
  77. PROCEDURE RGB2HSV(rColor: RGBColor;VAR hColor: HSVColor);
  78.     INLINE $3F3C,$0008,$A82E;
  79. FUNCTION GetColor(where: Point;prompt: Str255;inColor: RGBColor;VAR outColor: RGBColor): BOOLEAN;
  80.     INLINE $3F3C,$0009,$A82E;
  81.  
  82. {$ENDC}    { UsingPicker }
  83.  
  84. {$IFC NOT UsingIncludes}
  85.     END.
  86. {$ENDC}
  87.  
  88.